<template>
  <div class="notice-tips">
    <Badge dot :count="countComputed">
      <Button type="text" @click="openNotice">
        <Icon :size="20" type="ios-bug"/>
      </Button>
    </Badge>
  </div>
</template>

<script>
export default {
  name: 'NoticeTips',
  props: {
    count: {
      type: Number,
      default: 0
    },
    hasRead: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    countComputed () {
      return this.hasRead ? 0 : this.count
    }
  },
  methods: {
    openNotice () {
      this.$emit('show-notice')
    }
  }
}
</script>

<style lang="less">
  .notice-tips{
    margin-right: 12px;
    .ivu-badge-dot{
      top: 20px;
    }
    .ivu-btn.ivu-btn-text{
      padding: 5px 1px 6px;
    }
  }
</style>
